home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / msysjour / vol04 / 02a / mdi / mdi.h < prev    next >
Text File  |  1988-12-06  |  4KB  |  151 lines

  1. /*
  2.  * MDI.H - Include for MDI applications
  3.  *
  4.  * LANGUAGE      : Microsoft C5.1
  5.  * MODEL         : medium
  6.  * ENVIRONMENT   : Microsoft Windows 2.1 SDK
  7.  * STATUS        : operational
  8.  *
  9.  * Developed by:
  10.  *   Geoffrey Nicholls
  11.  *   Kevin P. Welch
  12.  *
  13.  * (C) Copyright 1988
  14.  * Eikon Systems, Inc.
  15.  * 989 E. Hillsdale Blvd, Suite 260
  16.  * Foster City  CA  94404
  17.  *
  18.  */
  19.  
  20. /* */
  21.  
  22. /*
  23.  *
  24.  * Public section of file
  25.  *
  26.  */
  27.  
  28. /* Window class for child windows */
  29. #define    WS_MDICHILD            WS_CAPTION    | WS_CHILD | WS_CLIPCHILDREN \
  30.                                                     | WS_VISIBLE | WS_THICKFRAME \
  31.                                                     | WS_CLIPSIBLINGS
  32.  
  33. /* How do we get our menu? */
  34. #define    MdiGetMenu(w)        GetProp(w,PROP_CHILDMENU)
  35. #define    MdiSetAccel(w,a)    SetProp(w,PROP_ACCEL,a)
  36.  
  37. /* Programmatic interface */
  38. HWND    MdiMainCreateWindow(    LPSTR, LPSTR, DWORD, int, int, int, int,
  39.                                     HWND, HMENU, HANDLE, LPSTR );
  40. long    MdiMainDefWindowProc( HWND, unsigned, WORD, LONG );
  41. HWND    MdiChildCreateWindow(    LPSTR, LPSTR, DWORD, int, int, int, int,
  42.                                         HWND, HMENU, HANDLE, LPSTR );
  43. long    MdiChildDefWindowProc( HWND, unsigned, WORD, LONG );
  44. BOOL    MdiGetMessage( HWND, LPMSG, HWND, WORD, WORD );
  45. int    MdiTranslateAccelerators( HWND, LPMSG );
  46.  
  47. /* Child System Menu Commands */
  48. /* Do not use these menu choices yourself */
  49. #define    IDM_CLOSE            0x3f00
  50. #define    IDM_RESTORE            0x3f01
  51. #define    IDM_NEXTWINDOW        0x3f02
  52. #define    IDM_PREVWINDOW        0x3f03
  53. #define    IDM_MOVE                0x3f04
  54. #define    IDM_SIZE                0x3f05
  55. #define    IDM_MAXIMIZE        0x3f06
  56.  
  57. /* Window Menu Choices */
  58. #define    IDM_NEWWINDOW        0x3f07
  59. #define    IDM_ARRANGE            0x3f08
  60. #define    IDM_ARRANGEALL        0x3f09
  61. #define    IDM_HIDE                0x3f0a
  62. #define    IDM_UNHIDE            0x3f0b
  63. #define    IDM_FIRSTWIN        0x3f0c
  64. #define    WINDOW_POS            8
  65.  
  66. /* */
  67.  
  68. /*
  69.  *
  70.  * Private section of file
  71.  *
  72.  */
  73.  
  74. /* Window data for the MDI parent */
  75. #define    PROP_ACTIVE            "MdiParentActiveChild"
  76. #define    PROP_COUNT            "MdiParentChildCount"
  77. #define    PROP_HIDDEN            "MdiParentHiddenCount"
  78. #define    PROP_ZOOM            "MdiParentChildZoomed"
  79. #define    PROP_MAINMENU        "MdiParentMenu"
  80. #define    PROP_WINDOWMENU    "MdiParentWindowMenu"
  81. #define    PROP_CTRLACCEL        "MdiParentChildSysAccel"
  82. #define    PROP_SYSMENU        "MdiParentChildSysMenu"
  83. #define    PROP_TITLE            "MdiParentTitle"
  84.  
  85. /* Window data for MDI children */
  86. #define    PROP_LEFT            "MdiChildRestoreLeft"
  87. #define    PROP_TOP                "MdiChildRestoreTop"
  88. #define    PROP_WIDTH            "MdiChildRestoreWidth"
  89. #define    PROP_HEIGHT            "MdiChildRestoreHeight"
  90. #define    PROP_CHILDMENU        "MdiChildMenu"
  91. #define    PROP_ACCEL            "MdiChildAccel"
  92. #define    PROP_MENUID            "MdiChildId"
  93. #define    PROP_ISMDI            "MdiChildWeAreOne"
  94.  
  95. /* Unhide dialog box */
  96. #define    DLGUNHIDE_LB        0x100
  97.  
  98. /* Child system menu bitmap */
  99. #define    OBM_CLOSE    32767
  100.  
  101. /* Return values for WM_MENUCHAR (missing from windows.h) */
  102. #define    MC_ABORT                1
  103. #define    MC_SELECT            2
  104.  
  105. /* States for the keyboard interface for the menus */
  106. #define    POP_NONE                -3
  107. #define    POP_MAINSYS            -2
  108. #define    POP_CHILDSYS        -1
  109. #define    POP_MAIN1ST            0
  110.  
  111. /* */
  112.  
  113. /*
  114.  *
  115.  * Procedure prototypes
  116.  *
  117.  */
  118.  
  119. /* mdi2.c */
  120. HWND                        MdiCreateChildWindow( int );
  121. void                        MdiDestroyChildWindow( HWND );
  122. void                        MdiActivateChild( HWND, BOOL );
  123. void                        MdiActivateNextChild( HWND );
  124. void                        MdiActivatePrevChild( HWND );
  125. void                        MdiDeactivateChild( HWND );
  126. void                        MdiZoomChild( HWND );
  127. void                        MdiRestoreChild( HWND, BOOL );
  128. void                        MdiSwitchZoom( HWND, HWND );
  129. HWND                        MdiChooseNewActiveChild( HWND );
  130. void                        MdiHideChild( HWND );
  131. void                        MdiUnhideChild( HWND );
  132. int FAR PASCAL            MdiDlgUnhide( HWND, unsigned, WORD, LONG );
  133.  
  134. /* mdi3.c */
  135. void                        MdiZoomMenu( HWND );
  136. void                        MdiRestoreMenu( HWND );
  137. void                        MdiAppendWindowToMenu( HWND );
  138. void                        MdiReinsertWindowInMenu( HWND );
  139. void                        MdiRemoveWindowFromMenu( HWND, BOOL );
  140. void                        MdiWindowMenu( HWND, HMENU, BOOL );
  141. void                        MdiInitSystemMenu( HWND );
  142. HMENU                        MdiGetChildSysMenu( void );
  143. HBITMAP                      MdiCreateChildSysBitmap( HWND );
  144. void                        MdiSetMenuKeyHook( HANDLE );
  145. void                        MdiMenuMessageLoopUpdate( HWND );
  146. LONG FAR PASCAL        MdiMsgHook( int, WORD, LONG );
  147. void                        MdiFreeMenuKeyHook( void );
  148.  
  149. /* External stuff (in windows) */
  150. LPSTR FAR PASCAL        lstrcpy( LPSTR, LPSTR );
  151.